package com.cbtx.module.base.ui;

import android.view.View;

import java.util.Calendar;

/**
 * author  Lambert on 2019-11-01
 */
public abstract class MyOnClickListener implements View.OnClickListener {

    public static final int MIN_CLICK_DELAY_TIME = 1500;
    private long lastClickTime = 0;

    @Override
    public void onClick(View v) {
        long currentTime = Calendar.getInstance().getTimeInMillis();
        if (currentTime - lastClickTime > MIN_CLICK_DELAY_TIME) {
            lastClickTime = currentTime;
            onMyClick(v);
        }

    }

    public abstract void onMyClick(View view);

}
